import 'package:flutter/cupertino.dart';
import 'package:flutter_base_widget/base/base.dart';
import 'package:flutter/material.dart';

class PickerPage extends BasePage {

  static List<String> coolColorNames = <String>[
    "abc",
    "blue",
    "grey",
    "black",
    "red",
    "purple",
    "pink",
    "green",
    "black",
    "cyan",
    "clown",
    "blueaccount",
  ];

  @override
  Widget rebuild(BuildContext context) {
    return Container(
      color: Colors.blue,
      child: Column(
        children: <Widget>[
            Flexible(
              flex: 1,
              child: CupertinoPicker(
                itemExtent: 30,
                onSelectedItemChanged: (idx){},
                children: List<Widget>.generate(coolColorNames.length, (int index){
                  return Container(
                    color: Colors.red,
                    padding: const EdgeInsets.only(top: 3,bottom: 3),
                    alignment: Alignment.center,
                    child: Text(coolColorNames[index]),
                  );
                }),
            ),
          ),
          Flexible(
            flex: 1,
            child: CupertinoDatePicker(
              mode: CupertinoDatePickerMode.date,
              onDateTimeChanged: (datetime){},
            ),
          ),
        ],
      )
    );
  }
}